<!--Begin All-->
    <div class="d_all">
		<!--Menu-->
                    <div class="tt_menu_2">
                    	<div class="pl20 pt10">
                            <?php echo $this->NewsCat(); ?>
                         </div>
                            <?php echo $this->render('/search_news.phtml'); ?>
                    </div>
                    
        <!--End Menu-->
    
    <!--Begin Contents-->
    <div class="d_contents_wrap_2">
    	<div class="d_space_height_10"></div>
		
        <!-- Left -->
        <div class="dd_ctsp">
        
        <?php 
            if(count($this->data) > 0) : 
            $news = new Default_Model_News();
            $product = new AdminDthink_Model_Product();
            foreach($this->data as $cat) :
        ?>
        <!-- Kênh tin-->
            <div class="ttct_top">
                <div class="pl20"><?php echo $cat['cat_name']; ?></div>
            </div>
            
            <div class="dd_ctsp_mid">
                <div class="dd_ctsp_mid">
            
            	<!--Tin con-->
            	<div class="ttct_tincon">
                    <?php 
                        $value = $news->listNews($cat['cat_id'], 1); 
                        if(count($value) > 0) :
                    ?>
                	<div class="ttct_tincon_p">
                    	<div class="pl20"><a href="<?php echo $this->baseUrl('news/details?id=') . $value[0]['news_id']; ?>"><img width="200px" height="200px" src="<?php echo $this->baseUrl('/public/files/news/') . $value[0]['news_image']; ?>"></a></div>
                    </div>
                    <div class="ttct_txt">
                    	<div class="pr20">
                            <div class="txt_title"><a href="<?php echo $this->baseUrl('news/details?id=') . $value[0]['news_id']; ?>"><?php echo $value[0]['news_title']; ?></a></div>
                            <div class="txt_date">Ngày 
                            <?php 
                                $sqldate = strtotime($value[0]['create_date']);
                                $create_date = date('d/m/Y', $sqldate);
                                echo $create_date; 
                            ?>
                            </div>
                            <div class="txt_normal">
                           	<?php
                                $content = preg_replace('/\s+/', ' ', $value[0]['news_plaintext']);
                                $content = $product->cut_string($content, 600, 1);
                                echo $content;
                            ?>                           
                            </div>
                            
                            <div class="d_space_height_10"></div>
                        </div>
                    </div>
                    
                    <div class="clear"></div>
                    
                    <?php $value2 = $news->listNews($cat['cat_id'], 5, 1); ?>
                    <div class="txt_other">
                   	    <ul>
                        <?php foreach($value2 as $row) : ?>
                            <li><a href="<?php echo $this->baseUrl('news/details?id=') . $row['news_id']; ?>">&raquo; <?php echo $row['news_title']; ?></a></li>
                        <?php endforeach; ?>
                        </ul>
                    </div>
                    <?php endif; ?>
                </div>
                <div class="clear"></div>
                <!--End Tin con-->
                
                </div>
            </div>
            
            <div class="dd_ctsp_bot"></div>
        <?php
            endforeach;
            endif;
        ?>
        <!-- End Kenh Tin -->

        </div>
        <!-- End Left -->    